package com.yicun.road.service.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yicun.road.service.mapper.TPointsMapper;
import com.yicun.road.service.pojo.disease.TPoints;
import com.yicun.road.service.service.TPointsService;
import com.yicun.road.service.util.PageUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author liushan
 * @since 2022-06-14
 */
@Service
public class TPointsServiceImpl extends ServiceImpl<TPointsMapper, TPoints> implements TPointsService {

    @Resource
    private TPointsMapper tPointsMapper;
    @Resource
    private PageUtil pageUtil;

    @Override
    public Page<TPoints> queryTPointsList(TPoints tPoints) {
        return tPointsMapper.queryTPointsList(pageUtil.defaultPage(tPoints.getCurrPage(), tPoints.getPageSize()), tPoints);

    }

    @Override
    public Object saveTPoints(TPoints tPoints) {
        return tPointsMapper.insert(tPoints);
    }

    @Override
    public void updateTPoints(TPoints tPoints) {
        tPointsMapper.updateById(tPoints);
    }

    @Override
    public void deleteTPoints(Integer id) {
        tPointsMapper.deleteById(id);
    }
}
